$INCLUDE: 'C:\FG\FASTGRAF.FI'

      PROGRAM MAIN

      INTEGER OLD_MODE
      INTEGER NEW_MODE
      INTEGER FG_AUTOMODE, FG_GETMODE
      CHARACTER*3 STRING

      CALL FG_INITPM
      OLD_MODE = FG_GETMODE()
      NEW_MODE = FG_AUTOMODE()
      CALL FG_SETMODE(NEW_MODE)

      CALL FG_SETCOLOR(15)
      CALL FG_TEXT('I''m running in mode ',20)
      WRITE(STRING,1000) NEW_MODE
      CALL FG_TEXT(STRING,3)
      CALL FG_WAITKEY

      CALL FG_SETMODE(OLD_MODE)
      CALL FG_RESET

      STOP ' '
1000  FORMAT(I2,'.')
      END
